package com.hjc.controller;

import com.hjc.entity.Auth;
import com.hjc.entity.Result;
import com.hjc.service.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/auth")
public class AuthController {
    @Autowired
    private AuthService authService;

//    http://localhost:3000/api/auth/auth-tree?_t=1696984551336
    @RequestMapping("/auth-tree")
    public Result loadAllAuth() {
        List<Auth> allAuthList = authService.findAllAuth();
        return Result.ok(allAuthList);
    }

}
